package com.hzw.saas.api.old.storage.bo;

import java.io.Serializable;
import javax.validation.constraints.Min;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;

import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.experimental.Accessors;

/**
 * @author zzl
 * @since 04/24/2021
 */
@Data
@Accessors(chain = true)
public class InxChunkBO implements Serializable {

    private static final long serialVersionUID = -62234903545015412L;

    /**
     * 文件ID
     * 备用
     */
    @NotBlank(message = "文件ID")
    @ApiModelProperty(value = "文件ID", position = 1, required = true)
    private String fileId;

    /**
     * 上传文件的文件名称
     */
    @ApiModelProperty(value = "上传文件名称", position = 3)
    private String filename;

    /**
     * 当前为第几块分片
     */
    @NotNull(message = "当前分片次序不可为空")
    @Min(value = 1, message = "当前分片次序不可小于1")
    @ApiModelProperty(value = "当前分片次序，次序从1开始的", position = 5, required = true)
    private Integer chunkNumber;

    /**
     * 总分片数量
     */
    @NotNull(message = "总分片数量不可为空")
    @Min(value = 1, message = "总分片数量不可小于1")
    @ApiModelProperty(value = "总分片数量", position = 6, required = true)
    private Integer totalChunks;

    /**
     * 每个分片大小
     */
    @NotNull(message = "每个分片大小不可为空")
    @Min(value = 0, message = "每个分片大小不可小于0")
    @ApiModelProperty(value = "每个分片大小", position = 7, required = true)
    private Long chunkSize;

    /**
     * 当前分片大小
     */
    @ApiModelProperty(value = "当前分片大小", position = 8, required = true)
    private Long currentChunkSize;

    /**
     * 总大小
     */
    @NotNull(message = "文件总大小不能为空")
    @Min(value = 0, message = "文件总大小不能小于0")
    @ApiModelProperty(value = "整体文件大小", position = 9, required = true)
    private Long totalSize;

    /**
     * 文件摘要，md5等
     */
    @ApiModelProperty(value = "分片MD5摘要", position = 10)
    private String digest;

    /**
     * 文件摘要类型
     * 备用
     */
    @ApiModelProperty(value = "摘要类型（可选），默认为MD5，支持MD5,SHA1,SHA256", position = 11)
    private String digestType;

}
